<!--
 * @Author: HeAo
 * @Date: 2021-10-15 09:45:53
 * @LastEditTime: 2021-10-15 09:56:15
 * @LastEditors: HeAo
 * @Description: 
 * @FilePath: \web2103-2105\web2105\3-2-Vue\day07\2-jQuery-ajax.html
 * 别乱动！
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>jquery-ajax</title>
  <script src="../js/jquery.js"></script>
  <script src="../js/qs.js"></script>
  <script>
    let qs = Qs
    const baseUrl = 'http://47.94.46.113:8888'
    const loginData = {
      username: 'admin1',
      password: 123321
    }
    const applyData = {
      name: 'larry',
      gender: 'female',
      telephone: '13455667788'
    }

    $.ajax({
      url: baseUrl + '/user/login',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data: JSON.stringify(loginData),
      success(res) {
        console.log(res);
      },
      error(error) {
        console.log(error);
      }
    })

    $.ajax({
      url: baseUrl + '/index/apply/saveOrUpdate',
      method: 'post',
      data: loginData,
      success(res) {
        console.log(res);
      },
      error(error) {
        console.log(error);
      }
    })
  </script>
</head>

<body>

</body>

</html>